import {
	request,
} from '@/api/request';
const apiList = [
	// /api/index/initData
	{
		name: 'initData',
		url: '/api/index/initData',
		method:'GET'
	},
	{
		// /api/index/getScene
		name: 'getScene',
		url: '/api/index/getScene',
		method:'GET'
	},
	{
		// /api/index/getSceneInfo
		name: 'getSceneInfo',
		url: '/api/index/getSceneInfo',
		method:'GET'
	},
	{
		// /api/index/infoCollect
		name: 'infoCollect',
		url: '/api/index/infoCollect'
	},
	// /api/index/undifinedOrder
	{
		name: 'undifinedOrder',
		url: '/api/index/undifinedOrder'
	},
	{
		// /api/index/cardUnifinedOrder
		name: 'cardUnifinedOrder',
		url: '/api/index/cardUnifinedOrder',
	},
	{
		// /api/index/getOrder?id=1
		name: 'getOrder',
		url: '/api/index/getOrder',
		method:'GET'
	},
	{
		// /api/index/cardUnifinedOrder
		name: 'finishOrder',
		url: '/api/user/finishOrder',
	},
]

module.exports = apiList.reduce((mode, params) => {
	mode[params.name] = (data) => request({
		url: params.url,
		method: params.method || 'POST',
		data
	})
	return mode
}, {})